function back(){
	setTimeout(()=>{
		uni.navigateBack();
	}, 500)
}

function toHome(){
	uni.switchTab({
		url:'/pages/tab/home/home',
	});
}
function toAgreement(){
	getApp().globalData.webUrl = "https://www.xksndf2002.cn/agreement.html";
	uni.navigateTo({
		url: '/main/web/web'
	})
}
function toPrivacy(){
	getApp().globalData.webUrl = "https://www.xksndf2002.cn/privacy.html";
	uni.navigateTo({
		url: '/main/web/web'
	})
}

//注册相关
function toRegister(){
	uni.navigateTo({
		url: '/main/register/register'
	})
}
function toRegisterPassword(){
	uni.navigateTo({
		url: "/main/register/register-password"
	})
}
function toRegister1(){
	uni.navigateTo({
		url: "/main/register/register1"
	})
}
function toRegister2(){
	uni.navigateTo({
		url: "/main/register/register2"
	})
}
function toRegister3(){
	uni.navigateTo({
		url: "/main/register/register3"
	})
}
function toRegister4(){
	uni.navigateTo({
		url: "/main/register/register4"
	})
}
function toRegister5(){
	uni.navigateTo({
		url: "/main/register/register5"
	})
}
function toRegister6(){
	uni.navigateTo({
		url: "/main/register/register6"
	})
}
function toRegister7(){
	uni.navigateTo({
		url: "/main/register/register7"
	})
}
function toRegister8(){
	uni.navigateTo({
		url: "/main/register/register8"
	})
}

//我的相关
function toAccount(){
	uni.navigateTo({
		url:'/main/mine/account/account'
	})
}
function toUpdatePassword(){
	uni.navigateTo({
		url:'/main/mine/password/password'
	})
}
function toVip(){
	uni.navigateTo({
		url: '/main/mine/vip/vip'
	})
}
function toRealname(){
	uni.navigateTo({
		url: '/main/mine/realname/realname'
	})
}
function toSetting(){
	uni.navigateTo({
		url: '/main/mine/setting/setting'
	})
}

//消息公告
function toNoticeDetail(params){
	uni.navigateTo({
		url: '/main/notice/detail/detail',
		success: res => {
			res.eventChannel.emit('sendData', params);
		},
		fail: res => {
			console.log('item', JSON.stringify(res));
		},
	})
}
function toNoticeList(){
	uni.navigateTo({
		url:'/main/notice/list/list'
	})
}

//用户相关
function toUserEdit(userId){
	uni.navigateTo({
		url: '/main/user/edit/edit?userId=' + userId
	})
}
function toUserInfo(txCode){
	uni.navigateTo({
		url: '/main/user/info/info?txCode=' + txCode
	})
}

function toDynamicPerson(userId){
	uni.navigateTo({
		url: '/main/dynamic/person/person?userId=' + userId,
	});
}
function toDynamicRelease(){
	uni.navigateTo({
		url: '/main/dynamic/release/release'
	})
}


function toGameRelease(){
	uni.navigateTo({
		url:'/main/game/release/release'
	})
}
function toGameDetail(data){
	uni.navigateTo({
		url:'/main/game/detail/detail',
		success: res => {
			res.eventChannel.emit('sendData', data);
		},
	})
}


export default {
	back,
	toHome,
	toAgreement,
	toPrivacy,
	//注册相关
	toRegister,
	toRegisterPassword,
	toRegister1,
	toRegister2,
	toRegister3,
	toRegister4,
	toRegister5,
	toRegister6,
	toRegister7,
	toRegister8,
	//我的相关
	toAccount,
	toUpdatePassword,
	toVip,
	toRealname,
	toSetting,
	//消息公告
	toNoticeDetail,
	toNoticeList,
	//用户
	toUserEdit,
	toUserInfo,
	//动态
	toDynamicPerson,
	toDynamicRelease,
	//搭圈
	toGameRelease,
	toGameDetail
}